package top.huxy.web.core;

import cn.hutool.core.date.DateUtil;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author aproz
 * @Date 2022/2/21
 */
@Data
@NoArgsConstructor
public class Result<T> {
    /**
     * 状态码
     */
    private int code;

    /**
     * 返回的数据
     */
    private T data;

    /**
     * 附带的消息
     */
    private String msg;

    /**
     * 响应时间
     */
    private String responseTime = DateUtil.now();

    public Result(int code, String msg, T data) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }
}
